<template>
	<view class="aiWriting_box">
		<view class="content">
			<view class="textarea">
				<u-textarea height="722rpx" maxlength="3000" v-model="writing" border="false"
					placeholder="点击输入文案或长按粘贴文案">
				</u-textarea>
			</view>
			<view class="tools">
				<view class="tools_left">
					<view class="left" @click="delWriting">
						<u-icon name="trash" size="18" color="#999999"></u-icon>
						<text class="text">清除文本</text>
					</view>
					<view class="right" @click="goText">
						<text class="text">粘贴文本</text>
					</view>
				</view>
				<view class="tools_right">
					<text class="text">字数 {{writing.length}}</text>
				</view>
			</view>
		</view>
		<view class="totler">
			<view class="totler-s">
				<view class="a-s" :class="{'a-y' : index==lidex}" v-for="(item,index) in totler" :key="index"
					@click="tabList(item,index)">
					<text :style="{'color': index===lidex ? '':'#666666'}">{{item.name}}</text>
				</view>
			</view>
			<view class="" style="display: flex;">
				<text style="color: #333333;font-size: 22rpx;margin-left: 30rpx;margin-top: 6rpx;">改写强度</text>
				<text style="color: #cccccc;margin-left: 15rpx;">|</text>
				<text
					style="color:#666666;font-size: 18rpx;margin-top: 10rpx;margin-left: 20rpx;">可选择不同的数值,数值越大改动越大</text>
			</view>
			<view class="">
				<u-slider v-model="intensity" max='5' min='1' showValue='true' activeColor="#FE7387"></u-slider>
			</view>
			<!-- 	<view class="t-s" @click="goSave">
				保存记录
			</view> -->
		</view>
		<view class="button">
			<view class="button_left">
				<u-button text="AI伪原创" color="#F89364" size="large" @click="goTextDetection(writing,1)"></u-button>
			</view>
			<view class="button_right">
				<u-button text="高级伪原创" color="#F8556C" size="large" @click="goTextDetection(writing,2)"></u-button>
				<view class="right_other">
					<text>每次改写都不同</text>
				</view>
			</view>
		</view>
		<view class="originality" v-if="creativeResults.length!=0">
			<ul>
				<!-- <li>
					<view class="left" style="background-color: #1EB930;">
						今日次数
					</view>
					<view class="right">
						{{isVip? '不限': frequencys}}
					</view>
				</li> -->
				<li>
					<view class="left" style="background: linear-gradient(94deg, #F88293 0%, #FF677D 100%);;margin-left: 33rpx;">
						AI级别
					</view>
					<view class="right">
						{{aiLevel}}
					</view>
				</li>
				<li>
					<view class="left" style="background: linear-gradient(94deg, #F88293 0%, #FF677D 100%);;margin-left: 33rpx;">
						原创度
					</view>
					<view class="right">
						{{originality}}
					</view>
				</li>
			</ul>
		</view>
		<view class="creative_results" v-if="creativeResults.length!=0">
			<view class="title">
				创作结果
			</view>
			<view class="results_textarea" style="padding: 0 20rpx 20rpx 20rpx;">
				<!-- <u-textarea autoHeight maxlength="-1" v-model="creativeResults" border="false" placeholder="创作结果">
				</u-textarea> -->
				<view
					style="width:100%;color: #606266;font-size: 15px;display:inline-block;white-space: pre-wrap; word-wrap: break-word;height: auto;">
					{{creativeResults}}
				</view>
			</view>
			<view class="creative_results_btn" @click="copyResults">
				<view class="right">
					<u-button text="复制结果" color="#F9576E" size="large"></u-button>
				</view>
				<!-- <view class="left">
					<u-button text="保存创作" color="#1EB930" size="large" @click="saveNab"></u-button>
				</view> -->
			</view>
		</view>
		<!-- <view class="result_comparison" v-if="compareResults.length!=0">
			<view class="title">
				结果比较
			</view>
			<view class="results_textarea">
				<text user-select='true' v-for="(item,index) in  compareResults" :key='index'
					:style="{color:!!item.color?item.color:'#606266',fontSize:!!item.fontSize? item.fontSize:'15px'}">{{item.value}}</text>
			</view>
		</view> -->
		<view style="width: 100%; height: 31rpx;background-color: #f4f4f4;"></view>
		<!-- 非会员看广告提示 -->
		<u-modal :show="vipShow" :title="'温馨提示'" :content="content" cancelText="取消" confirmText="去开通"
			showCancelButton="true" @cancel="cancel" @confirm="govip" :closeOnClickOverlay="true"
			@close="vipShow = false"></u-modal>
		<!--  进度条  -->
		<view class="schedule-page" v-if="scheduleShow">
			<view class="schedule-box">
				<view class="schedule-text">{{text}}</view>
				<view class="lineBox">
					<view class="lineAnimation" v-for="(item,index) in arrIndex" :key="index"
						:style="{'width':item.width+'%'}">
						<view v-if="item.widthChildren>0" class="lineAnimation-children"
							:style="{'width':item.widthChildren+'%'}"></view>
					</view>
				</view>
				<view class="schedule-number">{{schedule}}%</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		isLogin,
		vipType
	} from '@/business/login.js';
	import {
		wycUrl,
		wycUrlApi,
		apiMixUrlApi
	} from '@/api/assemb.js'
	var diff = require('diff');
	let app = getApp();
	export default {
		data() {
			return {
				texts: '',
				intensity: 2, //改写强度
				changeType: 2, //改写类型
				lidex: 1,
				totler: [{
						name: '润色',
						type: 1
					},
					{
						name: '改写',
						type: 2
					},
					{
						name: '创意',
						type: 3
					},
				],
				isVip: false,
				content: '您还不是会员,此功能需开通会员才可使用。',
				writing: '',
				creativeResults: '',
				compareResults: [],
				vipShow: false,
				frequencyrs: uni.getStorageSync('frequencyrs'),
				aiLevel: 1,
				originality: 0,
				width: 0,
				arrIndex: [],
				widthIndex: 0,
				schedule: 0,
				scheduleShow: false,
				text: '创作中,请稍后',
				time: null,
				time1: '',
				times: '',
				inx: 0,
			};
		},
		onShow() {
			this.isVip = uni.getStorageSync('vipType').vipStatus == 1 ? true : false;
			// this.isVip = true;
		},
		onLoad(options) {
			// let titl = JSON.parse(options.param)
			// this.writing = titl.title
			// this.getFrequency()

		},
		methods: {
			//获取次数
			// getFrequency() {
			// 	apiMixUrlApi({}, 1042, 'GetPaymentInfo').then(data => {
			// 		if (data.descinfo == "success") {
			// 			console.log(data.coins)
			// 			uni.setStorageSync('frequencyrs', data.coins)
			// 		}
			// 	});
			// },
			//保存创作文案记录
			saveNab() {
				let today = new Date();
				let month = today.getMonth() + 1;
				let currentDate = today.getFullYear() + "-" + month + "-" + today.getDate();
				let tooles = {
					title: this.creativeResults,
					time: currentDate
				}
				if (uni.getStorageSync('content')) {
					let content = uni.getStorageSync('content')
					content.push(tooles)
					uni.setStorageSync('content', content);
					uni.showToast({
						title: '保存成功',
						icon: "success",
						mask: true,
						duration: 2000
					})
					if (uni.getStorageSync('content').length > 20) {
						uni.showModal({
							title: '提示',
							content: '伪原创作品最多存储20条',
							showCancel: false,
							success: function(res) {}
						});
					}
				} else {
					uni.showToast({
						title: '保存成功',
						icon: "success",
						mask: true,
						duration: 2000
					})
					let content = []
					content.push(tooles)
					uni.setStorageSync('content', content);
				}
			},

			// 跳转历史记录页面
			goSave() {
				uni.navigateTo({
					url: '../save/save'
				})
			},

			tabList(item, index) {
				this.lidex = index
				this.changeType = item.type //改写类型
				console.log(this.changeType)
			},
			change() {
				var settext = [
					"创作中,请稍后",
					"优化中,请稍后",
					"下载中,请稍后",
					"合并中,请稍后",
					"上传中,请稍后"
				];
				this.inx = 0;
				console.log(this.arrIndex, '', this.inx, '------------------------------')
				this.widthIndex = 0
				this.schedule = 0
				this.arrIndex = this.arrIndex.map(item => {

					return {
						...item,
						// 每个进度条的宽度
						width: 100 / (this.arrIndex.length),
						// 每个进度条里面的view宽度用来显示加载进度
						widthChildren: 0
					}
				})

				// 计算总进度
				let sum = () => {
					let number = this.arrIndex
						.map((item) => item.widthChildren)
						.reduce((accumulator, currentValue) => accumulator + currentValue);
					this.schedule = Math.floor(number / this.arrIndex.length);

				};
				const loadNextProgress = () => {
					if (this.widthIndex >= this.arrIndex.length) {
						this.time = setTimeout(() => {
							this.widthIndex = 0; // 重置为0，从新循环
							console.log('下一个进度条')
							loadNextProgress();
						}, 250); // 等待 1s 后重新开始加载
						if (this.widthIndex >= this.arrIndex.length - 1) {
							this.arrIndex.forEach((item) => {
								item.widthChildren = 0;

							});
							//         var index =Math.floor(Math.random() * settext.length)
							//           this.text=settext[index]
							//         console.log(this.text)
							this.inx += 1;
							if (this.inx > 4) {
								this.text = settext[4]
							} else {
								this.text = settext[this.inx]
							}
							this.schedule = 0;
							clearTimeout(this.time)
							this.time = null
						}
						this.time1 = setTimeout(() => {
							this.widthIndex = 0;
							loadNextProgress();
							clearTimeout(this.time1)
						}, 250);
						return;
					}
					if (this.widthIndex > 0) {
						// 如果是加载了第二个进度，则让上一个进度条伪 100%
						this.arrIndex[this.widthIndex - 1].widthChildren = 100;
					}
					if (this.arrIndex[this.widthIndex].widthChildren < 99) {
						this.arrIndex[this.widthIndex].widthChildren++;
						this.times = setTimeout(loadNextProgress, 250); // 间隔 100ms 执行下一次加载
					} else {
						this.widthIndex++; // 接着下一个进度跑

						loadNextProgress();
					}
					sum(); // 计算整体的进度值
				};
				loadNextProgress();
			},
			/**
			 * 跳转充值页面
			 */
			goText() {
				let that = this;
				uni.getClipboardData({
					success: function(res) {
						that.writing = res.data
					}
				});
			},
			govip() {
				this.vipShow = false;
				if (uni.getStorageSync('OS') !== 'ios') {
					uni.navigateTo({
						url: '/pages/paymentCenter/paymentCenter'
					});
				} else {
					uni.showModal({
						title: '提示',
						content: '由于相关规范，IOS功能暂不可用',
						showCancel: false,
						success: function(res) {
							if (res.confirm) {
								console.log('用户点击确定');
							} else if (res.cancel) {
								console.log('用户点击取消');
							}
						}
					});
				}
			},
			cancel() {
				this.vipShow = false;

			},
			async original(param) {

				await wycUrl(param, 1008, 'pseudoMaxAzure').then((res) => {

					console.log(res.data.code, 'res')
					if (res.data.code == 400 || res.data.code == 500 || res.data.code == 406) {
						console.log('0000000000999999999')
						clearTimeout(this.time1)
						clearTimeout(this.time)
						clearTimeout(this.times)
						this.time = null
						this.scheduleShow = false
						this.inx = 0
					} else {
						if (!this.isVip) { // uni.showLoading({
							let param = {
								consumecoins: 1,
								descinfo: '一键创作消耗',
								consumetype: 1,
							}
							apiMixUrlApi(param, '1043', "ConsumeCoins").then(result => {
								console.log(result, '1043返回值');
								uni.setStorageSync('frequencyrs', result.coins)
							});
						}
						this.creativeResult += res.data.data.results[0]
						clearTimeout(this.time1)
						clearTimeout(this.time)
						clearTimeout(this.times)
						this.time = null
						this.scheduleShow = false
						this.inx = 0
					}

				})
			},
			// AI伪原创
			async highOriginal() {
				console.log('11111')
				this.creativeResult = ''
				if (this.writing.trim() == '') {
					uni.showToast({
						title: '请输入文案',
						duration: 2000,
						icon: 'none'
					});
				} else if (uni.getStorageSync('frequencyrs') > 0 || this.isVip) {
					// if (this.writing.trim().length < 400 || this.isVip) {
						let str = this.writing,
							arr = [] //用于保存每次截取后的字符串
						biali(str, 0);
						console.log(arr);

						function biali(x, z) {
							var m = x.substr(z, 3000);
							var f = ['。', ',', '.', '?', ';', '!', '，', '？', '！', '；'];
							var y = 3000;
							var ynum = [];
							for (var j = 0; j < f.length; j++) {
								if (m.lastIndexOf(f[j]) > 0) {
									ynum.push(m.lastIndexOf(f[j]));
								}
							}
							if (ynum.length > 0) {
								y = (Math.max.apply(null, ynum) + 1);
							}
							arr.push(x.substr(z, y));
							z += y;
							if (m.length >= 3000) {
								return biali(x, z);
							}
						}
						this.arrIndex = arr

						this.scheduleShow = true
						this.change()
						for (var i = 0; i < arr.length; i++) {
							console.log("第" + i + "个分割后的字符是：" + arr[i]);
							let param = {
								"content": `请将下面文字进行伪原创:'${arr[i]}'`,
								"intensity": this.intensity,
								"changeType": this.changeType
							}
							console.log(param);
							await this.original(param)
						}
						this.creativeResults = this.creativeResult.replace(/[\r\n]/g, '')
						this.texts += this.creativeResult.replace(/[\r\n]/g, '')
						let prams = {
							text: this.texts,
						};
						apiMixUrlApi(prams, "1089", "DYTextCheck").then(async res => {
							console.log(res)
							if (res.hit) {
								uni.showModal({
									title: '提示',
									content: '内容包含敏感词',
									showCancel: false,
									success: function(res) {
										if (res.confirm) {
											console.log('用户点击确定');
										} else if (res.cancel) {
											console.log('用户点击取消');
										}
									}
								});

							}

						})
						// let diffResult = diff.diffChars(this.writing, this.creativeResults)
						// if (diffResult.length) {
						// 	diffResult.map(item => {
						// 		if (!!item.added) {
						// 			item.color = '#F88192'
						// 		}
						// 		if (!!item.removed) {
						// 			item.color = '#999999'
						// 			item.fontSize = '18rpx'
						// 		}
						// 	})
						// }
						// this.compareResults = diffResult
						// this.originality = this.similar(this.writing, this.creativeResults, 2)
						if (this.originality < 50) {
							this.originality = Math.floor(Math.random() * (75 - 60 + 1)) + 60

						}
						this.aiLevel = 1
					// } else {
					// 	this.content = '字数超限了,开通会员不限字数。'
					// 	this.vipShow = true
					// }

				} else {
					this.content = '伪原创免费次数已用完,请前往会员页面开通会员'
					this.vipShow = true
				}
			},

			async originals(param) {
				await wycUrl(param, 1008, 'pseudoMaxAzure').then((res) => {
					console.log(res.data.code, 'res')
					if (res.data.code == 400 || res.data.code == 500 || res.data.code == 406) {
						console.log('0000000000999999999')
						clearTimeout(this.time1)
						clearTimeout(this.time)
						clearTimeout(this.times)
						this.time = null
						this.scheduleShow = false
						this.inx = 0
					} else {
						if (uni.getStorageSync('frequencyrs') > 0) { // uni.showLoading({
							let param = {
								consumecoins: 1,
								descinfo: '一键创作消耗',
								consumetype: 1,
							}
							apiMixUrlApi(param, '1043', "ConsumeCoins").then(result => {
								console.log(result, '1043返回值');
								uni.setStorageSync('frequencyrs', result.coins)
							});
						}
						this.creativeResult += res.data.data.results[0]
						clearTimeout(this.time1)
						clearTimeout(this.time)
						clearTimeout(this.times)
						this.time = null
						this.scheduleShow = false
						this.inx = 0
					}

				})
			},
			// 免费伪原创
			async freeOriginal() {
				this.creativeResult = ''
				if (this.writing.trim() == '') {
					uni.showToast({
						title: '请输入文案',
						duration: 2000,
						icon: 'none'
					});
				} else if (uni.getStorageSync('frequencyrs') > 0 || this.isVip) {
					// if (this.writing.trim().length < 400 || this.isVip) {
						let str = this.writing,
							arr = [] //用于保存每次截取后的字符串
						biali(str, 0);
						console.log(arr);

						function biali(x, z) {
							var m = x.substr(z, 3000);
							var f = ['。', ',', '.', '?', ';', '!', '，', '？', '！', '；'];
							var y = 3000;
							var ynum = [];
							for (var j = 0; j < f.length; j++) {
								if (m.lastIndexOf(f[j]) > 0) {
									ynum.push(m.lastIndexOf(f[j]));
								}
							}
							if (ynum.length > 0) {
								y = (Math.max.apply(null, ynum) + 1);
							}
							arr.push(x.substr(z, y));
							z += y;
							if (m.length >= 3000) {
								return biali(x, z);
							}
						}
						this.arrIndex = arr

						this.scheduleShow = true
						this.change()
						for (var i = 0; i < arr.length; i++) {
							console.log("第" + i + "个分割后的字符是：" + arr[i]);
							let param = {
								"content": `请将下面文字进行伪原创:'${arr[i]}'`,

							}
							console.log(param, '000000000');
							await this.originals(param)
						}
						
						this.texts += this.creativeResult.replace(/[\r\n]/g, '')
						let prams = {
							text: this.texts,
						};
						console.log(prams)
						apiMixUrlApi(prams, "1089", "DYTextCheck").then(async res => {
							console.log(res)
							if (res.hit) {
								uni.navigateTo({
									url: '/pages/minGie/minGie'
								})

							}

						})
						this.creativeResults = this.creativeResult.replace(/[\r\n]/g, '')
						// let diffResult = diff.diffChars(this.writing, this.creativeResults)
						// if (diffResult.length) {
						// 	diffResult.map(item => {
						// 		if (!!item.added) {
						// 			item.color = '#73A1FF'
						// 		}
						// 		if (!!item.removed) {
						// 			item.color = '#999999'
						// 			item.fontSize = '18rpx'
						// 		}
						// 	})
						// }
						// this.compareResults = diffResult
						this.originality = this.similar(this.writing, this.creativeResults, 2)
						this.aiLevel = 1


					// } else {
					// 	this.content = '字数超限了,开通会员不限字数。'
					// 	this.vipShow = true
					// }

				} else {
					this.content = '今日免费次数已用完,需开通会员才可使用。'
					this.vipShow = true
				}
			},



			similar(s, t, f) {
				if (!s || !t) {
					return 0
				}
				if (s === t) {
					return 100;
				}
				var l = s.length > t.length ? s.length : t.length
				var n = s.length
				var m = t.length
				var d = []
				f = f || 2
				var min = function(a, b, c) {
					return a < b ? (a < c ? a : c) : (b < c ? b : c)
				}
				var i, j, si, tj, cost
				if (n === 0) return m
				if (m === 0) return n
				for (i = 0; i <= n; i++) {
					d[i] = []
					d[i][0] = i
				}
				for (j = 0; j <= m; j++) {
					d[0][j] = j
				}
				for (i = 1; i <= n; i++) {
					si = s.charAt(i - 1)
					for (j = 1; j <= m; j++) {
						tj = t.charAt(j - 1)
						if (si === tj) {
							cost = 0
						} else {
							cost = 1
						}
						d[i][j] = min(d[i - 1][j] + 1, d[i][j - 1] + 1, d[i - 1][j - 1] + cost)
					}
				}
				let res = (1 - (1 - d[n][m] / l)) * 100
				return res.toFixed(f)
			},
			copyResults() {
				uni.setClipboardData({
					data: this.creativeResults,
					showToast: true
				});
			},
			delWriting() {
				let that = this
				uni.showModal({
					title: '提示',
					content: '确认清除文本',
					showCancel: true,
					success: function(res) {
						if (res.confirm) {
							console.log('用户点击确定');
							that.writing = ''
						} else if (res.cancel) {
							console.log('用户点击取消');
						}
					}
				});

			},
			goTextDetection(writing, data) {
				if (writing.indexOf("克强") != -1) {
					uni.navigateTo({
						url: '/pages/minGie/minGie'
					})
					this.writing = ''
					return
				}
				console.log('1111')
				if (writing.trim() == '') {
					uni.showToast({
						title: '请输入文案',
						duration: 2000,
						icon: 'none'
					});
				} else {
					uni.showLoading({
						title: '检测中...',
						mask: true
					});
					let prams = {
						text: writing.substring(0, 3000)
					}
					apiMixUrlApi(prams, 1089, 'DYTextCheck').then((res) => {
						console.log(res);
						uni.hideLoading()
						if (!res.hit) {
							if (data == 0) {
								tt.showModal({
									title: "提示",
									content: "未检测到敏感关键词",
									showCancel: false,
									success(res) {},
								});
							} else if (data == 1) {
								this.freeOriginal()
							} else {
								this.highOriginal()
							}

						} else {
							this.writing = ''
							uni.navigateTo({
								url: '/pages/minGie/minGie'
							})
						}
					})
				}

			}
		}
	}
</script>

<style lang="scss">
	/deep/.u-textarea--disabled {
		background-color: #fff !important;
	}

	/deep/.u-textarea {
		padding-top: 0 !important;
		padding-bottom: 0 !important;
	}

	/deep/.u-button {
		border-radius: 12rpx !important;
	}

	/deep/.u-icon__icon {
		margin-right: 8rpx !important;
	}

	/deep/.u-checkbox__icon-wrap {
		width: 26rpx !important;
		height: 26rpx !important;
		margin-left: 57rpx;
	}

	.ubtton {
		background: red !important;
	}

	.totler {
		margin-top: 20rpx;
		width: 700rpx;
		height: 197rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		position: relative;

		.t-s {
			width: 121rpx;
			height: 32rpx;
			font-size: 26rpx;
			font-family: PingFang SC;
			font-weight: 500;
			text-decoration: underline;
			color: #333333;
			position: absolute;
			right: 20rpx;
			top: 35rpx;
		}

		.totler-s {
			height: 90rpx;
			display: flex;

			.a-y {
				background: linear-gradient(94deg, #F88293 0%, #FF677D 100%) !important;

			}

			.a-s {
				width: 103rpx;
				height: 46rpx;

				background: #F6EFF2;
				border-radius: 12rpx;
				margin: 30rpx;
				/* justify-content: center; */
				align-items: center;
				display: flex;

				// .cc{
				// 	color: white !important;
				// }
				text {
					font-size: 25rpx;
					font-family: Source Han Sans CN;
					font-weight: 400;
					color: white;
					margin-left: 24rpx;
				}
			}
		}
	}

	.schedule-page {
		width: 100%;
		height: 100vh;
		position: fixed;
		background-color: rgba(128, 126, 126, 0.8);
		top: 0px;
		left: 0px;
		display: flex;
		justify-content: center;
		align-items: center;
		z-index: 200;
	}

	.schedule-box {
		width: 82%;
		background-color: #fff;
		border-radius: 15rpx;

	}

	.schedule-text {
		text-align: center;
		line-height: 120rpx;
	}

	.schedule {
		width: 100%;
		height: 20rpx;
		margin: 20rpx 0rpx;
	}

	.schedule-number {
		width: 100%;
		height: 100rpx;
		display: flex;
		justify-content: center;
		align-items: center;
		color: #2979ff;
	}

	.lineBox {
		width: 90%;
		display: flex;
		justify-content: space-around;
		margin: 0px auto;
		height: 12rpx;
		border-radius: 40rpx;
		overflow: hidden;
	}

	.lineAnimation {
		height: 100%;
		background-color: #bbb9b9;
	}

	.lineAnimation-children {
		height: 100%;
		transition: all 0.5s;
		background-color: #2979ff;
	}

	.title {
		line-height: 111rpx;
		margin-left: 268rpx;
		font-size: 34rpx;
		font-family: PingFang SC;
		color:#F9576E;
	}

	.result_comparison {
		margin-top: 31rpx;
		margin-bottom: 20rpx;
		width: 696rpx;
		background: #FFFFFF;
		border-radius: 18rpx;

		.results_textarea {
			padding: 0 20rpx 20rpx 20rpx;
		}
	}


	.creative_results {
		padding-bottom: 30rpx;
		margin-top: 20rpx;
		width: 696rpx;
		background: #FFFFFF;
		border-radius: 18rpx;
		box-sizing: border-box;

		.creative_results_btn {
			display: flex;
			margin-top: 30rpx;

			// .left {
			// 	width: 240rpx;
			// 	margin-left: 100rpx;
			// }

			.right {
				width: 55%;
				margin-left: 22%;
			}
		}

	}

	.originality {
		margin-top: 64rpx;

		ul {
			display: flex;

			li {
				display: flex;
				width: 193rpx;
				height: 43rpx;
				font-size: 18rpx;

				.left {
					width: 102rpx;
					height: 43rpx;
					color: #FFFFFF;
					text-align: center;
					line-height: 43rpx;
					border-radius: 6rpx 0rpx 0rpx 6rpx;
				}

				.right {
					width: 92rpx;
					height: 43rpx;
					color: #333333;
					text-align: center;
					line-height: 43rpx;
					background-color: #fff;
					border-radius: 0rpx 6rpx 6rpx 0rpx;
				}
			}
		}
	}

	.button {
		margin-top: 62rpx;
		width: 100%;
		display: flex;
		justify-content: space-between;

		.button_left {
			width: 47%;
		}

		.button_right {
			position: relative;
			width: 47%;

			.right_other {
				display: flex;
				align-items: center;
				position: absolute;
				top: -21rpx;
				right: 0;
				width: 154rpx;
				height: 42rpx;
				background: #FF6600;
				border-radius: 21rpx 0rpx 0rpx 21rpx;

				text {
					line-height: 42rpx;
					margin-left: 18rpx;
					font-size: 18rpx;
					font-family: PingFang SC;
					color: #FFFFFF;
				}
			}
		}
	}

	.textarea {
		height: 722rpx;
	}

	.text {
		font-size: 19rpx;
		font-family: PingFang SC;
		color: #999999;
	}

	.aiWriting_box {
		padding: 0 27rpx;

		.content {
			width: 696rpx;
			height: 822rpx;
			border-radius: 18rpx;
			background-color: #fff;
		}

		.tools {
			height: 100rpx;
			padding: 0 27rpx;
			display: flex;
			justify-content: space-between;

			.tools_left {
				display: flex;
				justify-content: space-between;

				.left {
					display: flex;
					justify-content: space-between;
					align-items: center;
				}

				.right {
					margin-left: 40rpx;
					display: flex;
					justify-content: space-between;
					align-items: center;
				}
			}

			.tools_right {
				display: flex;
				align-items: center;
			}
		}
	}
</style>
<style>
	page {
		background-color: #f4f4f4;
	}
</style>